package com.zhengtoon.mctoon.conv.dao.sdzc;

import org.apache.ibatis.annotations.Param;

import com.zhengtoon.mctoon.conv.bean.sdzc.Letter;

import java.util.List;

/**
 * 信件DAO接口
 *
 * @author 刘振华
 * @since 2017-04-12
 * Copyright: Copyright (c) 2017
 * Company:北京政务通有限公司
 */
public interface LetterMapper {


    /**
     * 查询他人信件详情
     *
     * @param sysLetterId
     * @return
     */
    Letter queryOthersLetterById(@Param("sysLetterId") String sysLetterId);

    /**
     * 查询他人信件列表
     *
     * @param ghlLetterId, ghlCommunityCode, ghlCommunityUuid, ghlSysLetterId, ghlLetterType, ghlLetterTitle, ghlLetterContent, ghlOpenType, ghlAnonymousType, ghlOrgId, ghlRemindType, ghlWriter, ghlWriterName, ghlWriterEmail, ghlWriterMobile, ghlWriterTelephone, ghlWriterPostCode, ghlWriterAddress, ghlStatus, createTime, updateTime
     * @return Letter
     */
    Letter selectSingle(String ghlLetterId, String ghlCommunityCode, String ghlCommunityUuid, String ghlSysLetterId, String ghlLetterType, String ghlLetterTitle, String ghlLetterContent, String ghlOpenType, String ghlAnonymousType, String ghlOrgId, String ghlRemindType, String ghlWriter, String ghlWriterName, String ghlWriterEmail, String ghlWriterMobile, String ghlWriterTelephone, String ghlWriterPostCode, String ghlWriterAddress, String ghlStatus, String createTime, String updateTime);

    /**
     * 获取他人信件列表
     *
     * @param userId
     * @param letterType
     * @param offSet
     * @param limit
     * @return
     */
    List<Letter> queryOthersLetterList(@Param("userId") String userId, @Param("letterType") String letterType, @Param("offSet") Integer offSet, @Param("limit") Integer limit);

    /**
     * 获取我的未回复信件列表  144637
     *
     * @param userId
     * @param offSet
     * @param limit
     * @return
     */
    List<Letter> queryMyNotReplyLetterList(@Param("userId") String userId, @Param("offSet") Integer offSet, @Param("limit") Integer limit);

    /**
     * 获取我的已回复信件列表  144637
     *
     * @param userId
     * @param offSet
     * @param limit
     * @return
     */
    List<Letter> queryMyReplyLetterList(@Param("userId") String userId, @Param("offSet") Integer offSet, @Param("limit") Integer limit);

    /**
     * 根据userId和内部信件id查询信件详情    144637
     *
     * @param userId
     * @param sysLetterId
     * @return
     */
    Letter queryLetterByUserIdAndSysLetterId(@Param("userId") String userId, @Param("sysLetterId") String sysLetterId);

    /**
     * 提交信件 144637
     *
     * @param letter
     * @return
     */
    Integer addLetter(Letter letter);

    /**
     * 根据转办信件id更新北京通内部状态    144637
     *
     * @param transferLetterId
     */
    void updateBjtStatusByTransferId(String transferLetterId);

    /**
     * 更新信件表    144637
     *
     * @param letterEntity
     */
    void updateLetter(Letter letterEntity);

    /**
     * 更新内部状态   144637
     *
     * @param sysLetterId
     */
    void updateBjtStatusBySysLetterId(String sysLetterId);

    /**
     * 根据sysLetterId 查询userId   144637
     *
     * @param sysLetterId
     * @return
     */
    Letter queryLetterBySysLetterId(@Param("sysLetterId") String sysLetterId);

    /**
     * 根据内部信件id更新open状态 144637
     *
     * @param sysLetterId
     * @return
     */
    boolean updateOpenTypeBySysLetterId(String sysLetterId);

    /**
     * 更新不受理信件   144637
     *
     * @param letterEntity
     */
    int updateNotAcceptLetter(Letter letterEntity);


    /**
     * 根据convId 查询信件详情  144637
     *
     * @param convId
     * @return
     */
    Letter queryLetterByConvId(Long convId);
}